#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define y1 y_alpha_1

using namespace std;

using ll = long long;
using db = double;
using vec = vector<int>;
using pii = pair<int,int>;

int read() {
	int x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-',ch = getchar();
	while(isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48),ch = getchar();
	return f ? -x : x;
}

const int N = 510;

bitset < N > f[10][N][N];
int n,m,d[N << 2],id[N];
char s[N][N];

void build(int o = 1,int dep = 0,int l = 1,int r = n) {
	int mid = l + r >> 1; d[o] = dep;
	for(int i = 1;i <= m;i++) {
		if(s[mid][i] == '.') {
			f[dep][mid][i][i] = 1;
			if(s[mid][i - 1] == '.') f[dep][mid][i] |= f[dep][mid][i - 1];
		}
	}
	for(int i = mid + 1;i <= r;i++)
		for(int j = 1;j <= m;j++)
			if(s[i][j] == '.') f[dep][i][j] |= f[dep][i][j - 1] | f[dep][i - 1][j];
	for(int i = m;i;i--) {
		f[dep][mid][i].reset();
		if(s[mid][i] == '.') {
			f[dep][mid][i][i] = 1;
			if(s[mid][i + 1] == '.') f[dep][mid][i] |= f[dep][mid][i + 1];
		}
	}
	for(int i = mid - 1;i >= l;i--)
		for(int j = m;j;j--)
			if(s[i][j] == '.') f[dep][i][j] |= f[dep][i + 1][j] | f[dep][i][j + 1];
	if(l == r) return id[l] = o,void();
	build(o << 1,dep + 1,l,mid); build(o << 1 | 1,dep + 1,mid + 1,r);
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in;m = in;
	for(int i = 1;i <= n;i++) scanf("%s",s[i] + 1);
	build();
	int Q = in;
	while(Q--) {
		int x1 = in,y1 = in,x2 = in,y2 = in;
		int u = id[x1],v = id[x2];
		while(d[u] > d[v]) u >>= 1; while(d[u] < d[v]) v >>= 1; while(u ^ v) u >>= 1,v >>= 1;
		puts((f[d[u]][x1][y1] & f[d[u]][x2][y2]).count() ? "Yes" : "No");
	}
	return 0;
}
